<script setup>

const rules = {
  username: [
    { required: true, message: '请输入昵称', trigger: 'blur' },
    {
      pattern: /^\S{1,20}$/,
      message: '昵称必须是1-20位的非空字符串',
      trigger: 'blur'
    }
  ],
  phone: [
    { required: true, message: '请输入手机号', trigger: 'blur' },
    { pattern: /^1[3456789]\d{9}$/, message: '手机号格式不正确', trigger: 'blur' }
  ],
  email: [
    { required: true, message: '请输入邮箱', trigger: 'blur' },
    { type: 'email', message: '邮箱格式不正确', trigger: 'blur' }
  ]
}


</script>
<template>
  <el-card class="page-container">
    <template #header>
      <div class="header">
        <span>基本资料</span>
      </div>
    </template>
    <el-row>
      <el-col :span="12">
        <el-form :rules="rules" label-width="100px" size="large">
          <el-form-item label="用户名">
            <el-input  disabled></el-input>
          </el-form-item>
          <el-form-item label="昵称" prop="username">
            <el-input ></el-input>
          </el-form-item>
          <el-form-item label="手机号" prop="phone">
            <el-input ></el-input>
          </el-form-item>
          <el-form-item label="邮箱" prop="email">
            <el-input ></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" >提交修改</el-button>
          </el-form-item>
        </el-form>
      </el-col>
    </el-row>
  </el-card>
</template>